package com.m.imagelookview;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;

import androidx.appcompat.app.AppCompatActivity;

import com.bumptech.glide.Glide;
import com.m.imagelookviewlib.ImageLookViewT;


public class MainActivity extends AppCompatActivity {
    int i = 0;
    private ImageLookViewT iv;
    private Button btn;
    private Button btn1;
    private Button btn2;
    private Button qbtn;
    private Button qbtwn;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        iv = findViewById(R.id.iv);

        Glide.with(this).load("https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg-article.pchome.net%2F00%2F43%2F75%2F06%2Fpic_lib%2Fwm%2Favatar_01.jpg&refer=http%3A%2F%2Fimg-article.pchome.net&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1611972179&t=37aa5664cbc75cd80ae7aed60559f7d7").into(iv);


         //Glide.with(this).load("https://himg.bdimg.com/sys/portraitn/item/203e757579676b6f8b43").into(iv);

        //Glide.with(this).load("https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=3711202985,2135929914&fm=26&gp=0.jpg").into(iv);

        initView();
    }

    private void initView() {
        btn = (Button) findViewById(R.id.btn);
        btn1 = (Button) findViewById(R.id.btn1);
        btn2 = (Button) findViewById(R.id.btn2);
        btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                iv.setRotate(90);
            }
        });
        btn2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                iv.setRotate(10);
            }
        });
        btn1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                iv.setRotate(-10);
            }
        });
        qbtn = (Button) findViewById(R.id.qbtn);
        qbtwn = (Button) findViewById(R.id.qbtwn);
        qbtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                iv.setRotate(-90);
            }
        });
        qbtwn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                // startActivity(new Intent(MainActivity.this,teActivity.class));
                iv.getscalevalue();
            }
        });
    }
}
